#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char *s;
    char(*w)[100];
    s=(char *)malloc(1100*sizeof(char));
    w=(char(*)[100])malloc(100*sizeof(char[100]));
    int p=0,q=0,t=0,j;
    gets(s);
    while(s[p]!='\0'&&s[q]!='\0')
    {
        while(s[p]==' ')
        {
            p++;
        }
        if(s[p]=='\0')
            break;
        q=p;
        while(s[q+1]>='a'&&s[q+1]<='z'||s[q+1]>='A'&&s[q+1]<='Z'||s[q+1]==','||s[q+1]=='.')
        {
            q++;
        }
        j=0;
        for(int i=p;i<=q;i++)
        {
            w[t][j]=s[i];
            j++;
        }
        w[t][j]='\0';
        t++;
        p=q+1;
    }
    printf("%d\n",t);
    for(int i=0;i<t;i++)
    {
        printf("%s\n",w[i]);
    }
    free(s);
    s=NULL;
    free(w);
    w=NULL;
    return 0;
}
